<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>{$title}</title>
    <link rel="stylesheet" type="text/css" href="//cdn.bilnn.top/js/aui/aui.2.0.css"/>
    <link rel="stylesheet" type="text/css" href="//cdn.bilnn.top/js/aui/aui-slide.css"/>
    <style>
        body{

        }
    </style>
</head>
<body>
<header class="aui-bar aui-bar-nav">
   
    <a class="aui-pull-right aui-btn aui-btn-outlined" aui-popup-for="top-right">
        <i class="aui-iconfont aui-icon-menu"></i>
    </a>
    <a class="aui-pull-right">
        {if $user}{$user.score}积分{/if}
    </a>
  
    <div class="aui-title"></div>
</header>
<div class="aui-popup aui-popup-top-right" id="top-right">
    <div class="aui-popup-arrow"></div>
    <div class="aui-popup-content">
        <ul class="aui-list aui-list-noborder">
            <li class="aui-list-item">
                <div class="aui-list-item-label-icon">
                    <i class="aui-iconfont aui-icon-comment aui-text-info"></i>
                </div>
                <div class="aui-list-item-inner" onclick="load_recharge()">
                    立即充值
                </div>
            </li>
            <li class="aui-list-item">
                <div class="aui-list-item-label-icon">
                    <i class="aui-iconfont aui-icon-my aui-text-warning"></i>
                </div>
                <div class="aui-list-item-inner aui-list-item-middle" onclick="window.location.href='?c=game&a=duobao_log'">
                    夺宝记录
                </div>
            </li>
            <li class="aui-list-item">
                <div class="aui-list-item-label-icon">
                    <i class="aui-iconfont aui-icon-calendar aui-text-success"></i>
                </div>
                <div class="aui-list-item-inner aui-list-item-middle" onclick="window.location.href='?c=gift&a=my_gift&backurl='+encodeURIComponent(window.location.href)">
                    我的背包
                </div>
            </li>
        </ul>
    </div>
</div>
<div id="aui-slide" style="display: none">
    <div class="aui-slide-wrap" >
        <div class="aui-slide-node bg-dark">
            <img src="" alt=""/>
        </div>
    </div>
    <div class="aui-slide-page-wrap"><!--分页容器--></div>
</div>
<div class="aui-tab" id="tab">
    <div class="aui-tab-item {if $action=='free'}aui-active{/if}" style="z-index: 1;" onclick="window.location.href='?c=game&a=duobao&action=free'">免费场</div>
    <div class="aui-tab-item {if $action=='newuser'}aui-active{/if}" style="z-index: 1;" onclick="window.location.href='?c=game&a=duobao&action=newuser'">新手场</div>
</div>
<div class="aui-content aui-margin-b-0">
    <ul class="aui-list aui-media-list">
        <li class="aui-list-header">
            适度游戏，切勿沉迷，礼物只用于打赏不可用于其他用途。
        </li>
        {foreach from=$lists item=one}
         <li class="aui-list-item" style="padding-right: 0.75rem;">
            <div class="aui-media-list-item-inner">
                <div class="aui-list-item-media" onclick="window.location.href='?c=game&a=duobao_view&id={$one.id}'">
                    <img src="/app{$one.gift_pic}">
                </div>
                <div class="aui-list-item-inner">
                    <div class="aui-list-item-text">
                        <div class="aui-list-item-title" onclick="window.location.href='?c=game&a=duobao_view&id={$one.id}'">{$one.name}</div>
                        <div class="aui-list-item-right" style="color: red">￥{$one.gift_price}元</div>
                    </div>
                    <div class="aui-list-item-text">
                        {$one.mark}
                    </div>
                </div>
            </div>
            <div class="aui-progress aui-progress-xs">
                    <div class="aui-progress-bar" style="width: {$one.progress}%;"></div>
                </div>
            <div class="aui-info aui-margin-t-5" style="padding-top:0;color: #146d98">
                <div class="aui-info-item">
                    <i class="aui-iconfont aui-icon-date"></i><span>第<span style="color: red">{$one.lssue}</span>期</span>
                </div>
                <div class="aui-info-item">
                    <span style="margin-right: 0.5rem">共需<span style="color: red">{$one.need_num}</span>人次</span>
                    <span>{if $one.need==0}<span style="color: red">等待开奖</span>{else}距开奖剩余<span style="color: red">{$one.need}</span>人次{/if}</span>
                </div>
            </div>
            <div style="text-align: right;">
                <div class="aui-btn aui-btn-info aui-btn-outlined aui-btn-sm" onclick="window.location.href='?c=game&a=duobao_view&id={$one.id}'">立即夺宝</div>
            </div>

            <p style="padding-top:0.5rem"></p>
        </li>
        {/foreach}
    </ul>
</div>
</body>
<script src="//apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
<script src="//cdn.bilnn.top/js/aui/aui-dialog.js"></script>
<script src="//cdn.bilnn.top/js/aui/aui-toast.js"></script>
<script src="//cdn.bilnn.top/js/aui/aui-slide.js"></script>
<script src="//cdn.bilnn.top/js/aui/aui-popup.js" ></script>
<script src="View/js/fun.js"></script>

<script>
    var popup = new auiPopup();
    var slide = new auiSlide({
        container:document.getElementById("aui-slide"),
        //"width":500,
        "height":240,
        "speed":500,
        "autoPlay": 3000, //自动播放
        "loop":true,
        "pageShow":true,
        "pageStyle":'dot',
        'dotPosition':'center'
    })

    function load_recharge(){
        popup.hide();
        setTimeout(function (){
            recharge();
        },500);
    }

    function recharge() {
        var dialog = new auiDialog();
        var toast = new auiToast();
        dialog.prompt({
            title:"充值积分",
            text:'请输入积分，10积分=1元',
            intval:true,
            value:"10",
            html:'<div class="aui-content aui-margin-t-15"><input class="aui-radio" type="radio" name="pay_id" checked style="height:1.2rem;min-height:1.2rem" value="alipay"> 支付宝支付&nbsp;&nbsp;&nbsp;&nbsp;<input class="aui-radio" type="radio" name="pay_id" style="height:1.2rem;min-height:1.2rem" value="wechat"> 微信支付</div>',
            buttons:['取消','确定']
        },function(ret){
            if(ret.buttonIndex == 2){
                if (ret.text==''){
                    toast.fail({
                        title:"充值金额为空",
                        duration:2000
                    });
                }else{
                    var back = vposts("/api/v3/vas/order",JSON.stringify({ action: "score",method:$("input[name='pay_id']:checked").val(),id:1,num:parseInt(ret.text)}));
                    if (back.code==0){
                        dialog.alert({
                            title:"扫码支付",
                            msg:'支付完成后刷新页面<br><img width="128" src="https://api.pwmqr.com/qrcode/create/?url='+encodeURIComponent(back.data.qr_code)+'">',
                            buttons:['确定']
                        },function(ret){
                            window.location.reload();
                        })
                    }else{
                        toast.fail({
                        title:back.msg,
                        duration:2000
                    });
                    }
                } 
            }
        })
    }
</script>
</html>